<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/05/27
 * Time: 下午 05:22
 */
class Api extends CI_Controller{
//    public function __construct()
//    {
//        parent::get_instance();
//    }
//

    public function photo()
    {
        $this->load->database();
        $data = $this->db->query("select id,MediaId,ThumbMediaId from message where MsgType = 'video' and IsOk=1 order by id desc limit 5")->result_array();
        foreach ($data as $k=>$v)
        {
            $data[$k]['image'] = "http://img.faxian001.com/".$v['ThumbMediaId'].'.jpg';
            $data[$k]['video'] = "http://img.faxian001.com/".$v['MediaId'].'.mp4';
        }
        echo json_encode($data,JSON_UNESCAPED_SLASHES);
    }
}
